package pcs.inline.gtalk;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.Menu.Item;
import android.widget.Button;

public class LoginActivity extends Activity {
	
	private static final int QUIT_ID = Menu.FIRST;
	Button mButtonLogin;
			
	@Override
	protected void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		setContentView(R.layout.gtalk_login);
		mButtonLogin = (Button) findViewById(R.id.confirm_login);
						
		mButtonLogin.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {				
				/* Ao clicar no botao, chama-se a atividade GTalkClient */
				Intent i = new Intent(LoginActivity.this, GTalkClient.class);	            	            	            
	            startActivity(i);
			}
		});
	}	
	
	/* ----------- Menu ---------------*/
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		super.onCreateOptionsMenu(menu);
		menu.add(0, QUIT_ID, "Sair");		
		return true;
	}
	
	@Override
	public boolean onMenuItemSelected (int featureId, Item item) {
		switch (item.getId()) {
		case QUIT_ID:
			finish();
			return true;						
		}		
		return super.onMenuItemSelected(featureId, item);	
		
	}
}
